#!/bin/sh

m=`expr 1024 "*" 8`
o=0

while [ "$m" -ge "$o" ]; do
s=$m
i=`echo "obase=2; $m" | bc`
iL=`echo $i|awk '{print length($i)}'`

	if [ "$iL" -lt "16" ]
	then
		z_number=`expr 16 - $iL`
		j=$i
		while [ "$z_number" -gt "$o" ]; do
			j=0$j
			z_number=`expr $z_number - 1`
		done
	fi

jL=`echo $j|awk '{print length($j)}'`

L1=`echo $j|awk '{print substr($j,1,4)}'`
L2=`echo $j|awk '{print substr($j,5,4)}'`
L3=`echo $j|awk '{print substr($j,9,4)}'`
L4=`echo $j|awk '{print substr($j,13,4)}'`

l1=`echo "obase=16; ibase=2; $L1"|bc`
l2=`echo "obase=16; ibase=2; $L2"|bc`
l3=`echo "obase=16; ibase=2; $L3"|bc`
l4=`echo "obase=16; ibase=2; $L4"|bc`

echo "$l1$l2$l3$l4"
echo "$l1$l2$l3$l4" >> ot

m=`expr $s - 1`
done
